/* eslint-disable no-redeclare */
// To parse this data:
//
//   import { Convert, Chs9001 } from "./file";
//
//   const chs9001 = Convert.toChs9001(json);

export interface Chs9001 {
    cainfo:          string;
    dev_no:          string;
    dev_safe_info:   string;
    fixmedins_code:  string;
    fixmedins_name:  string;
    inf_time:        string;
    infno:           string;
    infver:          string;
    input:           Input;
    insuplc_admdvs:  string;
    mdtrtarea_admvs: string;
    msgid:           string;
    opter:           string;
    opter_name:      string;
    opter_type:      string;
    recer_sys_code:  string;
    sign_no:         string;
    signtype:        string;
}

export interface Input {
    signIn: SignIn;
}

export interface SignIn {
    ip:       string;
    mac:      string;
    opter_no: string;
}

// Converts JSON strings to/from your types
export class Chs9001 {
    public static toChs9001(json: Object): Chs9001 {
        const temp = JSON.stringify(json)
        return JSON.parse(temp)
    }

    public static chs9001ToJson(value: Chs9001): string {
        return JSON.stringify(value);
    }

    //初始化结算单的请求参数
    public static init(): Chs9001 {
        let a = `
        {
            "infno": "9001",
            "msgid": "H45019900055202203231147179456",
            "mdtrtarea_admvs": "450199",
            "insuplc_admdvs": "450199",
            "recer_sys_code": "MBS_LOCAL",
            "dev_no": "",
            "dev_safe_info": "",
            "cainfo": "",
            "signtype": "SM2",
            "infver": "V1.0",
            "opter_type": "1",
            "opter": "1633138901983008485",
            "opter_name": "测试收费",
            "inf_time": "2022-03-23 11:47:17",
            "fixmedins_code": "H45012400011",
            "fixmedins_name": "海南测试医院",
            "sign_no": "",
            "input": {
                "signIn": {
                    "opter_no": "1633138901983008485",
                    "mac": "D8C4976F3988",
                    "ip": "192.168.33.1"
                }
            }
        }
        `
        return this.toChs9001(JSON.parse(a))
        
    }
}
